package collection;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;

public class CollectionToArray {
    public static void main(String[] args) {
        Collection<String> a = new ArrayList<>();
        a.add("one");
        a.add("two");
        a.add("three");
        a.add("four");
        a.add("five");
        System.out.println(a);

        String[] b = a.toArray(new String[0]);
        System.out.println(Arrays.toString(b));
    }
}
